/*
 * sender.h
 *
 *  Created on: 2011-7-24
 *      Author: minorityee1984@gmail.com
 *     Purpose: CSenderBase, 數據傳輸器基類
 *        Note:
 */

#ifndef SENDER_H_
#define SENDER_H_

#include "type_def.h"

class CSenderBase
{
public:
	CSenderBase();
	virtual ~CSenderBase();
	// 初始化Receiver
	virtual int Initialize() = 0;
	// 销毁Receiver
	virtual int Uninitialize() = 0;
	/*
	 * Purpose: 传输数据
	 *    Args: pszBuf 传入缓冲区指针，函数将从头部开始传输
	 *          uLen 传入要传送的数据大小，传出实际传输的数据大小
	 *  Return：错误码
	 *    Note:
	 */
	virtual uint16_t Send(const Byte *pszBuf, uint16_t &uLen) = 0;
	void SetDestID(int nSouceID)
	{
		m_nDestID = nSouceID;
	}
	int GetDestID()
	{
		return m_nDestID;
	}
private:
	int m_nDestID;
};

#endif /* SENDER_H_ */
